package com.zhoushihao.class0815;

import java.util.*;

public class Ball {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int L = sc.nextInt();
        int t = sc.nextInt();
        Map<Integer, Integer> locationsMap = new TreeMap<>();
        Map<Integer, Integer> directionsMap = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            locationsMap.put(i + 1, x);
            directionsMap.put(i + 1, 1);
        }
        for (int i = 1; i <= t; i++) {
            for (Map.Entry<Integer, Integer> entry : locationsMap.entrySet()) {
                int x = entry.getValue();
                int direction = directionsMap.get(entry.getKey());
                if (x == 0 || x == L) {
                    directionsMap.put(entry.getKey(), direction * -1);
                }
                for (Map.Entry<Integer, Integer> entry_2 : locationsMap.entrySet()) {
                    if (x == entry_2.getValue() && entry_2.getKey() != entry.getKey()) {
                        int direction_1 = directionsMap.get(entry_2.getKey());
                        directionsMap.put(entry_2.getKey(), direction_1 * -1);
                    }
                }
            }
            for (Map.Entry<Integer, Integer> entry : locationsMap.entrySet()) {
                int x = entry.getValue();
                x += directionsMap.get(entry.getKey());
                entry.setValue(x);
            }
        }
        for (Map.Entry<Integer, Integer> entry : locationsMap.entrySet()) {
            System.out.print(entry.getValue() + " ");
        }
    }
}

